#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <string.h>

int main() {
    char ch[1000];
    int letter_count = 0;
    int space_count = 0;
    int num_count = 0;
    int other_count = 0;
    gets(ch);
    for (int i = 0; i < strlen(ch); i++)
    {
        if ((ch[i] >= 'a' && ch[i] <= 'z')
            || (ch[i] >= 'A' && ch[i] <= 'Z'))
        {
            letter_count++;
        }
        else if (ch[i] == ' ')
        {
            space_count++;
        }
        else if (ch[i] >= '0' && ch[i] <= '9')
        {
            num_count++;
        }
        else
        {
            other_count++;
        }
    }
    printf("%d\n", letter_count);
    printf("%d\n", space_count);
    printf("%d\n", num_count);
    printf("%d\n", other_count);
    return 0;
}